<%--
  Created by IntelliJ IDEA.
  User: lijunhao
  Date: 16-11-2
  Time: 上午10:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/jspf/taglibs.jspf" %>
<div class="tf-menu-content" style="display: block;" id="area">
    <div class="panel-body">
        <div class="form-group">
            <label class="col-sm-3 control-label">投放区域</label>
            <div class="col-sm-7">
                <label class="radio-inline radio-inline-tf" style="margin-left:-119px;">
                    <input type="radio" name="adTargetMarketType" value="1" <c:if test="${form.adDirected.adTargetMarketType==1 }">checked="checked"</c:if>> 不限
                </label>
                <label class="radio-inline">
                    <input id="adTargetMarketTypeArea" type="radio" name="adTargetMarketType" value="2"
                           <c:if test="${form.adDirected.adTargetMarketType==2 }">checked="checked"</c:if>> 地区
                </label>

                <div class="areaSelect" <c:if test="${form.adDirected.adTargetMarketType==1 }">style="display:none"</c:if>>

                    <div class="province choose-area-model">
                        <div class="areaModal-header">
                        选择省
                        </div>
                        <ul class="province-list list choose-province" >
                            <c:forEach items="${form.provinces }" varStatus="i" var="province">
                                <li class="" data-val="${ province.id}">${province.name }</li>
                            </c:forEach>
                        </ul>
                    </div>


                    <div class="city choose-area-model">
                        <div class="areaModal-header">
                        选择市
                        </div>
                        <ul class="city-list list">
                        
                        </ul>
                    </div>


                    <div class="content choose-area-model">
                        <div class="areaModal-header">
                        已选项
                        </div>
                        <ul class="content-list list">
                        </ul>
                    </div>
                    <input id="provinceList" type="hidden" value="${form.adDirected.adTargetMarketArea }">
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">性别</label>
            <div class="col-sm-6">
                <label class="radio-inline radio-inline-sex">
                    <input type="radio" name="adTargetGender" value="不限"
                           <c:if test="${fn:contains(form.adDirected.adTargetGender,'不限') }">checked="checked"</c:if>>不限
                </label>
                <label class="radio-inline">
                    <input type="radio" name="adTargetGender" value="男"
                           <c:if test="${fn:contains(form.adDirected.adTargetGender,'男') }">checked="checked"</c:if>> 男
                </label>
                <label class="radio-inline">
                    <input type="radio" name="adTargetGender" value="女"
                           <c:if test="${fn:contains(form.adDirected.adTargetGender,'女') }">checked="checked"</c:if>> 女
                </label>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">年龄</label>
            <div class="col-sm-6">
                <label class="checkbox-inline">
                    <input name="adTargetAge" type="checkbox" value="不限"
                           <c:if test="${fn:contains(form.adDirected.adTargetAge,'不限') }">checked="checked"</c:if>>不限
                </label>
                <label class="checkbox-inline">
                    <input name="adTargetAge" type="checkbox" value="自定义"
                           <c:if test="${fn:contains(form.adDirected.adTargetAge,'自定义') }">checked="checked"</c:if>>自定义
                </label>
                <div id="adTargetAge" <c:if test="${fn:contains(form.adDirected.adTargetAge,'不限') }">style="display:none"</c:if>>
                    <label class="checkbox-inline">
                        <input name="adTargetAge" type="checkbox" value="小于18"
                               <c:if test="${fn:contains(form.adDirected.adTargetAge,'小于18') }">checked="checked"</c:if>>小于18
                    </label>
                    <label class="checkbox-inline">
                        <input name="adTargetAge" type="checkbox" value="18-23"
                               <c:if test="${fn:contains(form.adDirected.adTargetAge,'18-23') }">checked="checked"</c:if>>18-23
                    </label>
                    <label class="checkbox-inline">
                        <input name="adTargetAge" type="checkbox" value="24-30"
                               <c:if test="${fn:contains(form.adDirected.adTargetAge,'24-30') }">checked="checked"</c:if>>24-30
                    </label>
                    <label class="checkbox-inline">
                        <input name="adTargetAge" type="checkbox" value="31-40"
                               <c:if test="${fn:contains(form.adDirected.adTargetAge,'31-40') }">checked="checked"</c:if>>31-40
                    </label>
                    <label class="checkbox-inline">
                        <input name="adTargetAge" type="checkbox" value="41-50"
                               <c:if test="${fn:contains(form.adDirected.adTargetAge,'41-50') }">checked="checked"</c:if>>41-50
                    </label>
                    <label class="checkbox-inline">
                        <input name="adTargetAge" type="checkbox" value="大于50"
                               <c:if test="${fn:contains(form.adDirected.adTargetAge,'大于50') }">checked="checked"</c:if>>大于50
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">婚姻状况</label>
            <div class="col-sm-6">
                <label class="checkbox-inline">
                    <input name="adTargetMarriage" type="checkbox" id="marriage" value="不限"
                           <c:if test="${fn:contains(form.adDirected.adTargetMarriage,'不限')}">checked="checked"</c:if>>不限
                </label>
                <label class="checkbox-inline">
                    <input name="adTargetMarriage" type="checkbox" value="自定义"
                           <c:if test="${fn:contains(form.adDirected.adTargetMarriage,'自定义')}">checked="checked"</c:if>>自定义
                </label>
                <div id="adTargetMarriage" <c:if test="${fn:contains(form.adDirected.adTargetMarriage,'不限')}">style="display:none"</c:if>>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetMarriage" value=" 已婚"
                               <c:if test="${fn:contains(form.adDirected.adTargetMarriage,'已婚')}">checked="checked"</c:if>>已婚
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetMarriage" value="未婚"
                               <c:if test="${fn:contains(form.adDirected.adTargetMarriage,'未婚')}">checked="checked"</c:if>>未婚
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetMarriage" value="离异"
                               <c:if test="${fn:contains(form.adDirected.adTargetMarriage,'离异')}">checked="checked"</c:if>>离异
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">商业兴趣</label>
            <div class="col-sm-6">
                <label class="checkbox-inline">
                    <input name="adTargetBusinessInterest" type="checkbox" value="不限" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'不限') }">checked="checked"</c:if>> 不限
                </label>
                <label class="checkbox-inline">
                    <input name="adTargetBusinessInterest" type="checkbox" value="自定义" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'自定义') }">checked="checked"</c:if>>自定义
                </label>
                <div id="adTargetBusinessInterest" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'不限') }">style="display:none"</c:if>>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetBusinessInterest" value="金融财经" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'金融财经') }">checked="checked"</c:if>> 金融财经
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetBusinessInterest" value="体育" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'体育') }">checked="checked"</c:if>>体育
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetBusinessInterest" value="文化历史" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'文化历史') }">checked="checked"</c:if>> 文化历史
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetBusinessInterest" value="娱乐" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'娱乐') }">checked="checked"</c:if>>娱乐
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetBusinessInterest" value="科技数码" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'科技数码') }">checked="checked"</c:if>> 科技数码
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetBusinessInterest" value="政治军事" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'政治军事') }">checked="checked"</c:if>> 政治军事
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetBusinessInterest" value="美容时尚" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'美容时尚') }">checked="checked"</c:if>> 美容时尚
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetBusinessInterest" value="游戏动漫" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'游戏动漫') }">checked="checked"</c:if>> 游戏动漫
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetBusinessInterest" value="旅游美食" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'旅游美食') }">checked="checked"</c:if>> 旅游美食
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetBusinessInterest" value="母婴育儿" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'母婴育儿') }">checked="checked"</c:if>> 母婴育儿
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetBusinessInterest" value="生活健康" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'生活健康') }">checked="checked"</c:if>> 生活健康
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetBusinessInterest" value="房产家装" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'房产家装') }">checked="checked"</c:if>> 房产家装
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetBusinessInterest" value="情感星座" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'情感星座') }">checked="checked"</c:if>> 情感星座
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetBusinessInterest" value="教育" <c:if test="${fn:contains(form.adDirected.adTargetBusinessInterest,'教育') }">checked="checked"</c:if>>教育
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">气温指数</label>
            <div class="col-sm-6">
                <label class="checkbox-inline">
                    <input name="adTargetTempeture" type="checkbox" value="不限" <c:if test="${fn:contains(form.adDirected.adTargetTempeture,'不限') }">checked="checked"</c:if>>不限
                </label>
                <label class="checkbox-inline">
                    <input name="adTargetTempeture" type="checkbox" value="自定义" <c:if test="${fn:contains(form.adDirected.adTargetTempeture,'自定义') }">checked="checked"</c:if>>自定义
                </label>
                <div id="adTargetTempeture" <c:if test="${fn:contains(form.adDirected.adTargetTempeture,'不限') }">style="display:none"</c:if>>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetTempeture" value="0度以下" <c:if test="${fn:contains(form.adDirected.adTargetTempeture,'0度以下') }">checked="checked"</c:if>>0度以下
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetTempeture" value="1-10度" <c:if test="${fn:contains(form.adDirected.adTargetTempeture,'1-10度') }">checked="checked"</c:if>>1-10度
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetTempeture" value="11-20度" <c:if test="${fn:contains(form.adDirected.adTargetTempeture,'11-20度') }">checked="checked"</c:if>>11-20度
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetTempeture" value="20-30度" <c:if test="${fn:contains(form.adDirected.adTargetTempeture,'20-30度') }">checked="checked"</c:if>>20-30度
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetTempeture" value="30-35度" <c:if test="${fn:contains(form.adDirected.adTargetTempeture,'30-35度') }">checked="checked"</c:if>>30-35度
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetTempeture" value="35度以上" <c:if test="${fn:contains(form.adDirected.adTargetTempeture,'35度以上') }">checked="checked"</c:if>>35度以上
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">湿度指数</label>
            <div class="col-sm-6">
                <label class="checkbox-inline">
                    <input name="adTargetHumidity" type="checkbox" value="不限" <c:if test="${fn:contains(form.adDirected.adTargetHumidity,'不限') }">checked="checked"</c:if>>不限
                </label>
                <label class="checkbox-inline">
                    <input name="adTargetHumidity" type="checkbox" value="自定义" <c:if test="${fn:contains(form.adDirected.adTargetHumidity,'自定义') }">checked="checked"</c:if>>自定义
                </label>
                <div id="adTargetHumidity" <c:if test="${fn:contains(form.adDirected.adTargetHumidity,'不限') }">style="display:none"</c:if>>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetHumidity" value="小于18" <c:if test="${fn:contains(form.adDirected.adTargetHumidity,'小于18') }">checked="checked"</c:if>>小于18
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetHumidity" value="18-23" <c:if test="${fn:contains(form.adDirected.adTargetHumidity,'18-23') }">checked="checked"</c:if>>18-23
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetHumidity" value="24-30" <c:if test="${fn:contains(form.adDirected.adTargetHumidity,'24-30') }">checked="checked"</c:if>>24-30
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetHumidity" value="31-40" <c:if test="${fn:contains(form.adDirected.adTargetHumidity,'31-40') }">checked="checked"</c:if>>31-40
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetHumidity" value="41-50" <c:if test="${fn:contains(form.adDirected.adTargetHumidity,'41-50') }">checked="checked"</c:if>>41-50
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetHumidity" value="大于50" <c:if test="${fn:contains(form.adDirected.adTargetHumidity,'大于50') }">checked="checked"</c:if>>大于50
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">紫外线指数</label>
            <div class="col-sm-6">
                <label class="checkbox-inline">
                    <input type="checkbox" name="adTargetRay" value="不限" <c:if test="${fn:contains(form.adDirected.adTargetRay,'不限') }">checked="checked"</c:if>> 不限
                </label>
                <label class="checkbox-inline">
                    <input type="checkbox" name="adTargetRay" value="自定义" <c:if test="${fn:contains(form.adDirected.adTargetRay,'自定义') }">checked="checked"</c:if>> 自定义
                </label>
                <div id="adTargetRay" <c:if test="${fn:contains(form.adDirected.adTargetRay,'不限') }">style="display:none"</c:if>>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetRay" value="0-2" <c:if test="${fn:contains(form.adDirected.adTargetRay,'0-2') }">checked="checked"</c:if>> 0-2
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetRay" value="3-4" <c:if test="${fn:contains(form.adDirected.adTargetRay,'3-4') }">checked="checked"</c:if>> 3-4
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetRay" value="5-6" <c:if test="${fn:contains(form.adDirected.adTargetRay,'5-6') }">checked="checked"</c:if>> 5-6
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetRay" value="7-9" <c:if test="${fn:contains(form.adDirected.adTargetRay,'7-9') }">checked="checked"</c:if>> 7-9
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetRay" value="大于10" <c:if test="${fn:contains(form.adDirected.adTargetRay,'大于10') }">checked="checked"</c:if>> 大于10
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">天气气象</label>
            <div class="col-sm-6">
                <label class="checkbox-inline">
                    <input type="checkbox" name="adTargetWeather" value="不限" <c:if test="${fn:contains(form.adDirected.adTargetWeather,'不限') }">checked="checked"</c:if>> 不限
                </label>
                <label class="checkbox-inline">
                    <input type="checkbox" name="adTargetWeather" value="自定义" <c:if test="${fn:contains(form.adDirected.adTargetWeather,'自定义') }">checked="checked"</c:if>> 自定义
                </label>
                <div id="adTargetWeather" <c:if test="${fn:contains(form.adDirected.adTargetWeather,'不限') }">style="display:none"</c:if>>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetWeather" value="晴" <c:if test="${fn:contains(form.adDirected.adTargetWeather,'晴') }">checked="checked"</c:if>> 晴
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetWeather" value="多云" <c:if test="${fn:contains(form.adDirected.adTargetWeather,'多云') }">checked="checked"</c:if>> 多云
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetWeather" value="阴" <c:if test="${fn:contains(form.adDirected.adTargetWeather,'阴') }">checked="checked"</c:if>> 阴
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetWeather" value="小雨" <c:if test="${fn:contains(form.adDirected.adTargetWeather,'小雨') }">checked="checked"</c:if>> 小雨
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetWeather" value="大雨" <c:if test="${fn:contains(form.adDirected.adTargetWeather,'大雨') }">checked="checked"</c:if>> 大雨
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetWeather" value="小雪" <c:if test="${fn:contains(form.adDirected.adTargetWeather,'小雪') }">checked="checked"</c:if>> 小雪
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetWeather" value="大雪" <c:if test="${fn:contains(form.adDirected.adTargetWeather,'大雪') }">checked="checked"</c:if>> 大雪
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetWeather" value="雾霾" <c:if test="${fn:contains(form.adDirected.adTargetWeather,'雾霾') }">checked="checked"</c:if>> 雾霾
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">设备价格定向</label>
            <div class="col-sm-6">
                <label class="checkbox-inline">
                    <input type="checkbox" name="adTargetDevicePrice" value="不限" <c:if test="${fn:contains(form.adDirected.adTargetDevicePrice,'不限') }">checked="checked"</c:if>> 不限
                </label>
                <label class="checkbox-inline">
                    <input type="checkbox" name="adTargetDevicePrice" value="自定义" <c:if test="${fn:contains(form.adDirected.adTargetDevicePrice,'自定义') }">checked="checked"</c:if>> 自定义
                </label>
                <div id="adTargetDevicePrice" <c:if test="${fn:contains(form.adDirected.adTargetDevicePrice,'不限') }">style="display:none"</c:if>>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetDevicePrice" value="1000元以下" <c:if test="${fn:contains(form.adDirected.adTargetDevicePrice,'1000元以下') }">checked="checked"</c:if>> 1000元以下
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetDevicePrice" value="1001-2000" <c:if test="${fn:contains(form.adDirected.adTargetDevicePrice,'1001-2000') }">checked="checked"</c:if>> 1001-2000
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetDevicePrice" value="2001-3000" <c:if test="${fn:contains(form.adDirected.adTargetDevicePrice,'2001-3000') }">checked="checked"</c:if>> 2001-3000
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetDevicePrice" value="3001-4000" <c:if test="${fn:contains(form.adDirected.adTargetDevicePrice,'3001-4000') }">checked="checked"</c:if>> 3001-4000
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetDevicePrice" value="4001-5000" <c:if test="${fn:contains(form.adDirected.adTargetDevicePrice,'4001-5000') }">checked="checked"</c:if>> 4001-5000
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetDevicePrice" value="5001-6000" <c:if test="${fn:contains(form.adDirected.adTargetDevicePrice,'5001-6000') }">checked="checked"</c:if>> 5001-6000
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetDevicePrice" value="6001-7000" <c:if test="${fn:contains(form.adDirected.adTargetDevicePrice,'6001-7000') }">checked="checked"</c:if>> 6001-7000
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetDevicePrice" value="7000以上" <c:if test="${fn:contains(form.adDirected.adTargetDevicePrice,'7000以上') }">checked="checked"</c:if>> 7000以上
                    </label>
                </div>

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">操作系统定向</label>
            <div class="col-sm-6">
                <label class="checkbox-inline">
                    <input type="checkbox" name="adTargetOs" value="不限" <c:if test="${fn:contains(form.adDirected.adTargetOs,'不限') }">checked="checked"</c:if>> 不限
                </label>
                <label class="checkbox-inline">
                    <input type="checkbox" name="adTargetOs" value="自定义" <c:if test="${fn:contains(form.adDirected.adTargetOs,'自定义') }">checked="checked"</c:if>> 自定义
                </label>
                <div id="adTargetOs" <c:if test="${fn:contains(form.adDirected.adTargetOs,'不限') }">style="display:none"</c:if>>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetOs" value="iOS" <c:if test="${fn:contains(form.adDirected.adTargetOs,'iOS') }">checked="checked"</c:if>> iOS
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetOs" value="Android" <c:if test="${fn:contains(form.adDirected.adTargetOs,'Android') }">checked="checked"</c:if>> Android
                    </label>
                    <label class="checkbox-inline">
                        <input type="checkbox" name="adTargetOs" value="手机网站" <c:if test="${fn:contains(form.adDirected.adTargetOs,'手机网站') }">checked="checked"</c:if>> 手机网站
                    </label>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">

        // 获取新增时保存的市ID(是一个字符串)
        var provinceList = $("#provinceList").val();
        if (provinceList) {
            var citys = [];
            // 字符串截取为数组并且赋值给citys
            if (provinceList != "" && provinceList != undefined) {
                citys = provinceList ? provinceList.split(',') : null;
            }
            if (citys != null) {
                 var province = [];
                 // 遍历赋值后的数组，且每项取前两个值并且赋值给新数组 province
                for (var a = 0; a < citys.length; a++) {
                    province.push(citys[a].substr(0, 2));
                }
                // 声明一个新数组并且把排除重复后的市数组赋值给它
                var city = $.unique(province);
                if (city != "" && city != undefined) {
                    // 遍历当前新数组
                    for (var i = 0; i < city.length; i++) {
                        // 省
                        var provinceActiveId = '';
                        var provinceActiveIdText = '';
                        var provinceList = $('.province-list li');
                        var obj = '';
                        // 遍历当前省
                        for (var j = 0; j < provinceList.length; j++) {
                            // 如果当前新数组中的某个值乘以10000为省里面某个值就把那个省赋值给obj对象
                            if ($(provinceList[j]).attr('data-val') == (city[i] * 10000)) {
                                obj = $(provinceList[j]);
                                provinceActiveId = $(provinceList[j]).attr('data-val');
                                provinceActiveIdText = $(provinceList[j]).text();
                            }
                        }
                        // 将对比过后赋值给obj对象的值都传入方法，调用ajax 获取市
                        handleCityType(provinceActiveId, 2,provinceActiveIdText, function () {
                            // 遍历最开始的后台返回的市
                            for (var c = 0; c < citys.length; c++) {
                                var cityList = $('body').find('.city-list li');
                                // 遍历市容器，如果后台返回的市与现在市容器的市一样，则把现在市容器中的值隐藏起来，且把一样的市在放入选中容器中。
                                for (var e = 0; e < cityList.length; e++) {
                                    if ($(cityList[e]).attr('id') == citys[c]) {
                                        $(cityList[e]).css('display','none');
                                        $('body').find('.content-list').append('<li value="'+citys[c]+'" id="'+citys[c]+'"><span class="provinceLabel">'+$(cityList[e]).attr('data-province')+' </span><span class="txt">'+$(cityList[e]).text()+'</span></li>')
                                    }
                                }
                            } 
                        },obj);
                    }
                }
            }
        }

        //地区选择
        $("input[name='adTargetMarketType']").change(function(){
            // 如果选择自定义时间
            if($(this).val()==2){
                // 就显示自定义时间容器
                $(this).parent("label").next("div").show();
            }
            // 如果选择不限
            if($(this).val()==1){
                // 就隐藏自定义时间容器
                $(this).parent("label").next().next("div").hide();
                $('#optgroup').multiSelect('deselect_all');
            }
        });
        //城市：省市
        $('.choose-province').find('li').on('click', function () {
            var id  = $(this).attr('data-val');
            var val = $(this).text();
            // 获取省ID和文案  调用接口获取市
            handleCityType(id,2,val,'',$(this));
        });

        function handleCityType(id,level,val,callback,obj){
            $.ajax({
                url: "/common/area/"+level+"/"+id,
                type: "GET",
                dataType: "json",
                cache: false,
                success: function(cityOrAreaList) {
                    // 获取市成功后首先清空市
                    $('.city-list').empty();
                    // 遍历结果把市放入市容器
                    for(var i=0;i<cityOrAreaList.length;i++){
                        obj.closest('.areaSelect').find('.city-list').append("<li value='"+cityOrAreaList[i].id+"' data-province="+val+" id='"+cityOrAreaList[i].id+"'>"+cityOrAreaList[i].name+"</li>")
                    }
                    var city = obj.closest('.areaSelect').find('.city-list li');
                    var text = obj.closest('.areaSelect').find('.content-list li');
                    // 获取选中项，遍历市，如果有市已经在选中项中选中了，就把那个市隐藏起来（比对ID）
                    for(var i=0; i< city.length; i++) {
                        for(var j = 0; j < text.length; j++) {
                            var cityId  = $(city[i]).attr('id');
                            var textId  = $(text[j]).attr('id');
                            if (cityId == textId) {
                                $(city[i]).css('display','none');
                            }
                        }
                    }
                    if (typeof callback == 'function') {
                        callback();
                    }


                    // 市点击
                    $('.city-list li').on('click',function() {
                        var id = $(this).attr('id');
                        var txt = $(this).text();
                        var province = $(this).attr('data-province');
                        // 将点击后的市放入 选中内容容器中，并且把当前点击的市隐藏起来
                        $(this).closest('.areaSelect').find('.content-list').append("<li value='"+id+"' id='"+id+"'><span class='provinceLabel'>"+province+" </span><span class='txt'>"+txt+"</span></li>");
                        $(this).css('display','none');
                    });


                    // 选中内容点击  查看当前市中的id有没有和现在点击的内容id相等的值，有的话就恢复显示 。把当前点击的内容删除掉
                    $('body').on('click', '.content-list li', function () {
                        var id  = $(this).attr('id');
                        var city = $(this).closest('.areaSelect').find('.city-list li');
                        for (var i = 0; i < city.length; i++) {
                            var cityId = $(city[i]).attr('id');
                            if (id == cityId) {
                                $(city[i]).css('display','block');
                            }
                        }
                        $(this).remove();
                    });
                }
            });
        };


        //点击不限按钮
        $("input[type=checkbox]").click(function(){
            //点击不限
            if($(this).val()=="不限"&&$(this).is(':checked')==true){
                $("#"+$(this)[0].name).hide();

                $(this).parent().parent().find("input").each(function(i,e){
                    if(i!=0){
                        $(this).prop("checked",false);
                    }
                })
            }
            if($(this).val()=="自定义"&&$(this).is(':checked')==false){
                $(this).prop("checked",true);
            }
            if($(this).val()=="自定义"&&$(this).is(':checked')==true){
                $(this).closest('div.col-sm-6').find('div').eq(0).css('margin-top','10px');
                //选择选项
                $("#"+$(this)[0].name).show();

                $(this).parent().parent().find("input").each(function(i,e){
                    if(i==0){
                        $(this).prop("checked",false);
                    }
                })
            }
        });
    </script>
</div>